package ar.uba.fi.taller2.jh.Disk;

public class DiskBlock {
	
	private boolean _isFree;
	private String _content;
	
	public DiskBlock(String content) {
		this._content = content;
		_isFree = content==null? true : false;
	}
	
	public synchronized String getContent() {
		return this.isFree()? "libre" : this._content;
	}

	public synchronized void setContent(String content) {
		this._content = content;
		this._isFree = content==null? true : false;
	}

	public synchronized boolean isFree() {
		return this._content=="0"? false : _isFree;
	}
	
	public synchronized void release() {
		this._isFree = true;
		this._content = null;
	} 
}